package com.smartstate.dataManagement.exception;



/**
 * 自定义异常
 *
 * @author Mark sunlightcs@gmail.com
 */
public class MyRException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private String msg;
    private String code = "500";

    public MyRException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public MyRException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public MyRException(String msg, String code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public MyRException(ErrorEnums errorCode) {
        super(errorCode.getDesc());
        this.msg = errorCode.getDesc();
        this.code = errorCode.getCode();
    }

    public MyRException(ErrorEnums errorCode, String msgee) {
        super(msgee);
        this.msg = msgee;
        this.code = errorCode.getCode();
    }

    public MyRException(String msg, String code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }


}
